<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0-beta/css/bootstrap-grid.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/TableExport/5.0.0-rc.11/css/tableexport.min.css" rel="stylesheet">
    <title>tableexport-lichenyi 导出   </title>
</head>
<body>
<div>
    <button class="btn btn-primary" id="excel-export" >Excel</button>
</div>
 <br/>
<div class="panel-body">
	
	<table id="data-table" class="table datatable">
		<thead>
			<td data-name="name">名称</td>
			<td data-name="count">次数</td>
			<td data-name="days">天数</td>
			<td data-name="signIn">签到</td>
			<td data-name="activity">活动</td>
			<td data-name="timePeriod">时间周期</td>
			<td data-name="updateTime">更新时间</td>
		</thead>
		<tbody>
		</tbody>
	</table>
</div>
<!-- START SCRIPTS -->
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<!-- XLSX (Excel 2007+ XML Format) -->
<script src="https://cdn.bootcss.com/xlsx/0.11.5/xlsx.core.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/blob-polyfill/1.0.20150320/Blob.js" ></script>
<script src="https://cdn.bootcss.com/FileSaver.js/2014-11-29/FileSaver.min.js"></script>
<script type="text/javascript" src="static/js/tableexport.excel.js" ></script>

<script>
	$(function() {
		/**
		 * 导出初始化
		 */
		$("table").tableExport({
			headers: true,				
			footers: true,           
			formats: ["xlsx"],
			filename: "导出excel",		//导出的文件名
			bootstrap: true,
			exportButtons: true,
			position: "bottom",
			ignoreRows: null,
			ignoreCols: null,
			trimWhitespace: true,
			excelExportId: 'excel-export',  //导出按钮的id
			dataUrl: "static/json/datas.json",
			dataParameter: {},
			resultKeys: []
		});
});
</script>
</body>
</html>